package com.webchat.ugc.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;

@Configuration
public class RedisConfig {

//    @Resource
//    private ChatNotifyRedisQueueListener notifyQueueListener;

    @Bean
    public RedisMessageListenerContainer container(RedisConnectionFactory redisConnectionFactory) {
        RedisMessageListenerContainer container = new RedisMessageListenerContainer();
        // 设置链接工厂
        container.setConnectionFactory(redisConnectionFactory);
        // 配置消息监听器
//        container.addMessageListener(notifyQueueListener, new ChannelTopic(MessageBroadChannelEnum.QUEUE_CHAT_NOTIFY.getChannel()));
        return container;
    }
}
